import unittest
from selenium import webdriver

from Page.Page import login_page
from Page.Role_Page import Role_Page
from Page.Settle_Page import  Settle_Page

from time import sleep

class TestCase(unittest.TestCase):
    #测试固件
    def setUp(self):
        self.driver = webdriver.Edge()
        self.driver.maximize_window()
        lp = login_page(self.driver)
        lp.act_login('admin', '123456')
        print('开始')
    def tearDown(self):
        sleep(5)
        self.driver.quit()
        print('结束')

    #输入框输入正确用户名，点击查询
    def test_21(self):
        po = Settle_Page(self.driver)
        po.jiesuan()
        sleep(2)
        po.jilu()
        sleep(2)
        po.shu()
        sleep(2)
        po.cha()

    # 点击查询 显示所有列表
    def test_22(self):
        po = Settle_Page(self.driver)

        po.jiesuan()
        sleep(2)
        po.jilu()
        sleep(2)
        po.cha()
    #输入框输入特殊字符，点击查询
    def test_23(self):
        po = Settle_Page(self.driver)

        po.jiesuan()
        sleep(2)
        po.jilu()
        sleep(2)
        po.shu_2()
        sleep(2)
        po.cha()
    #
    def test_24(self):
        po = Settle_Page(self.driver)

        po.jiesuan()
        sleep(2)
        po.jilu()
        sleep(2)
        po.cha()
    #点击审核，输入备注，点击提交
    def test_25(self):
        po = Settle_Page(self.driver)
        po.jiesuan()
        sleep(2)
        po.jilu()
        sleep(2)
        po.shen()
        sleep(2)
        po.bei()
        sleep(2)
        po.ti()

    # 点击审核，输入备注，点击取消
    def test_26(self):
        po = Settle_Page(self.driver)

        po.jiesuan()
        sleep(2)
        po.jilu()
        sleep(2)
        po.shen()
        sleep(2)
        po.bei()
        sleep(2)
        po.quxiao()

    #输入页码过大，点击前往
    def test_27(self):
        po = Settle_Page(self.driver)
        po.jiesuan()
        sleep(2)
        po.jilu()
        sleep(2)
        po.ye()
        sleep(2)
        po.go()
    #点击审核 ，点击否，输入备注，点击提交
    def test_28(self):
        po = Settle_Page(self.driver)
        po.jiesuan()
        sleep(2)
        po.jilu()
        sleep(2)
        po.shen()
        sleep(2)
        po.fou()
        sleep(2)
        po.bei()
        sleep(2)
        po.ti()
    #点击打款，点击失败，输入备注，点击提交
    def test_29(self):
        po = Settle_Page(self.driver)
        po.jiesuan()
        sleep(2)
        po.jilu()
        sleep(2)
        po.kuan()
        sleep(2)
        po.shibai()
        sleep(2)
        po.bei()
        sleep(2)
        po.quxiao()

    # 点击打款，输入备注，点击提交
    def test_30(self):
        po = Settle_Page(self.driver)

        po.jiesuan()
        sleep(2)
        po.jilu()
        sleep(2)
        po.kuan()
        sleep(2)
        po.bei()
        sleep(2)
        po.ti()



if __name__ == '__main__':
    unittest.main()
